package com.ruoyi.app.service.impl;

import com.ruoyi.app.domain.MemberMachine;
import com.ruoyi.app.service.impl.mapper.MemberMachineMapper;
import com.ruoyi.app.service.IMemberMachineService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class IMemberMachineServiceImpl implements IMemberMachineService {

    @Autowired
    private MemberMachineMapper memberMachineMapper;

    @Override
    public List<MemberMachine> getMemberMachineList(MemberMachine memberMachine) {

        List<MemberMachine> machineList = memberMachineMapper.selectMemberMachineList(memberMachine);
        return machineList;
    }

    @Override
    public int insertMemberMachine(MemberMachine memberMachine) {

        int res = memberMachineMapper.insertMemberMachine(memberMachine);
        return res;
    }

    @Override
    public boolean CheckMemberMachineIsExist(String machineCodes) {

        MemberMachine memberMachine = new MemberMachine();
        memberMachine.setCodes(machineCodes);
        List<MemberMachine> machineList = memberMachineMapper.selectMemberMachineList(memberMachine);
        if(machineList.size() > 0){
            return true;
        }else{
            return false;
        }
    }
}
